----------------------------------------------------------------------------------------------------------------------------------
--[[

    finiteuses 的复制体，用来 把官方的 finiteuses 的数据表，复制到自己的数据表里 并下发 client

]]--
----------------------------------------------------------------------------------------------------------------------------------
local hutao_com_finiteuses = Class(function(self, inst)
    self.inst = inst

    -- self.total = 100
    -- self.current = 100

    self.__total = net_float(inst.GUID,"hutao_com_finiteuses.total", "hutao_com_finiteuses_update")
    self.__total:set(100)
    self.__current = net_float(inst.GUID,"hutao_com_finiteuses.current", "hutao_com_finiteuses_update")
    self.__current:set(100)

    -- if TUNING.HUTAO_DEBUGGING_MODE then
    --     inst:ListenForEvent("hutao_com_finiteuses_update",function()
    --         print("hutao_com_finiteuses",self:GetCurrent(),self:GetMax())
    --     end)
    -- end

end)

------------------------------------------------------------------------------------------------------------------------------
---
    function hutao_com_finiteuses:SetMax(max)
        if TheWorld.ismastersim then
            self.__total:set(max)
        end
    end
    function hutao_com_finiteuses:GetMax()
        return self.__total:value()
    end
    function hutao_com_finiteuses:SetCurrent(current)
        if TheWorld.ismastersim then
            self.__current:set(current)
        end
    end
    function hutao_com_finiteuses:GetCurrent()
        return self.__current:value()
    end
    function hutao_com_finiteuses:GetPercent()
        return self:GetCurrent() / self:GetMax()
    end
------------------------------------------------------------------------------------------------------------------------------
return hutao_com_finiteuses







